Expand description

twilight-http-ratelimiting

Ratelimiting functionality for HTTP requests.

Discord ratelimits requests to the HTTP API both globally and per-route. For more information on the specifics, please take a look at Discord’s documentation.

This crate provides a common Ratelimiter trait that all ratelimiter implementations need to implement.

It also ships a default implementation, InMemoryRatelimiter, that manages the bucket states in memory.

Features

Tracing

The tracing feature enables logging via the tracing crate.

This is enabled by default.

Re-exports

pub use self::headers::RatelimitHeaders;
pub use self::in_memory::InMemoryRatelimiter;
pub use self::request::Method;
pub use self::request::Path;

Modules

Parse typed headers from a response.

In-memory based default Ratelimiter implementation used in twilight-http.

Request parameters for ratelimiting.

Flow for managing ratelimit tickets.

Structs

A bucket containing ratelimiting information for a Path.

Traits

An implementation of a ratelimiter for the Discord REST API.

Type Definitions

A generic error type that implements Error.

Future returned by Ratelimiter::has.